
class Banks:
    test = '123'

    def __init__(self, uname):
        self.name = uname
        self.__balance = 0
        self.__rate = 30
        self.__service_charge = 0.01
        self.title = 'Tapi Bank'

    def save_money(self, money):
        self.__balance += money
        print('存款', money, '完成')

    def withdraw_money(self, money):
        self.__balance -= money
        print('取款', money, '完成')

    def get_balance(self):
        print(self.name.title(), " 目前余额：", self.__balance)

    def __cal_rate(self, usa_d):
        return int(usa_d * self.__rate * (1-self.__service_charge))


hungbank = Banks('hung')
hungbank.save_money(100)
hungbank.get_balance()


class ShilinBanks(Banks):

    def __init__(self, uname):
        super().__init__(uname)
        pass

    def get_balance(self):
        print(self.name.title(), " 目前余额：", self.test)
    pass


ShilinBank = ShilinBanks('guo')

ShilinBank.save_money(100)
ShilinBank.get_balance()

print(type(ShilinBank))
print(isinstance(ShilinBank, ShilinBanks))
print(isinstance(ShilinBank, Banks))

'''
设计一个类Myschool，这个类包含属性name和score，这个类也有一个msg( )方法，程序设定Myschool对象时需传递2个参数，下列是示范设定方式：

     hung = Myschool(‘kevin', 80)

这个类的方法，主要是可以输出问候语和成绩，下列是示范输出。
Hi! Kevin,你的成绩是80分。
请留意英文名字第一个输出字母是大写。
'''


class Myschool:

    title = "Python School"

    def __init__(self, uname, uscore):
        self.name = uname
        self.score = uscore

    def msg(self):
        print("%s \nHi %s, 你的成绩是 %d" % (self.title, self.name, self.score))


hung = Myschool('Kevin', 80)
hung.msg()
